//
//  NavigationView.m
//  ActSistant
//
//  Created by Hieu Nguyen Trung on 2/28/13.
//

#import "NavigationView.h"

@implementation NavigationView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initializeViews];
    }
    return self;
}

-(id) initWithCoder:(NSCoder *)aDecoder{
    self = [super initWithCoder:aDecoder];
    if (self){
        [self initializeViews];
    }
    return self;
}

-(void) initializeViews{
    [self setBackgroundColor:[UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1]];
    // Initialization code
    self.btnBack = [[UIButton alloc] initWithFrame:CGRectMake(9, 14, 35, 20)];
    [self.btnBack setBackgroundImage:[UIImage imageNamed:@"backbar_button"] forState:UIControlStateNormal];
    self.btnRight1 = [[UIButton alloc] initWithFrame:CGRectMake(224, 1, 43, 43)];
//    [self.btnLeft1 setBackgroundImage:[UIImage imageNamed:@"setting_button"] forState:UIControlStateNormal];
    [self.btnRight1 setBackgroundImage:[UIImage imageNamed:@"buttonSetting2"] forState:UIControlStateNormal];
    self.btnRight2 = [[UIButton alloc] initWithFrame:CGRectMake(268, 1, 43, 43)];
    [self.btnRight2 setBackgroundImage:[UIImage imageNamed:@"buttonNotification"] forState:UIControlStateNormal];
    self.lblTitle = [[UILabel alloc] initWithFrame:CGRectMake(51, 11, 120, 25)];
    [self.lblTitle setBackgroundColor:[UIColor clearColor]];
    [self.lblTitle setTextColor:[UIColor whiteColor]];
    [self.lblTitle setFont:UIFontSystemBold(18)];
    [self.lblTitle setText:@"appname"];
}


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
    [self addSubview:self.btnBack];
    [self addSubview:self.btnRight1];
    [self addSubview:self.btnRight2];
    [self addSubview:self.lblTitle];
    [super drawRect:rect];
}


@end
